<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>单向绑定循环</title>
		<script type="text/javascript" src="js/knockout-3.4.0.js" ></script>
	</head>
	<body>
		<h1>循环多级对象</h1>
		<div id="_bindDemo">
			框架数量<span data-bind="text: node.count"></span>
			<table border="1">
				<thead>
					<tr>
						<th>JS框架</th>
						<th>难度</th>
					</tr>
				</thead>
				<tbody data-bind="foreach: node.items">
					<tr>
						<td data-bind="text: framework"></td>
						<td data-bind="text: stars"></td>
					</tr>
				</tbody>
			</table>
		</div>
	</body>
	<script type="text/jscript">
		var data = {
			node: {
				count: 2,
				items: [
					{
						framework: 'Knockout',
						stars: 5 
					},
					{
						framework: 'JQuery',
						stars: 3
					}
				]
			}
		};
		ko.applyBindings(data, document.getElementById('_bindDemo'));
	</script>
</html>
